import { Component, OnInit } from '@angular/core';
import { AxiosService } from '../../axios.service';


@Component({
  selector: 'app-beiliao-process',
  templateUrl: './beiliao-process.component.html',
  styleUrls: ['./beiliao-process.component.scss']
})
export class BeiliaoProcessComponent implements OnInit {
  listOfData;

  constructor(public axios: AxiosService) { }


  ngOnInit(): void {
    this.getData();
  }

  // 请求数据
  getData() {
    this.axios.axiosPost('QuerySegmentSchedule', { segment: 'beiliao' })
      .then((data) => {
        this.listOfData = data['order'];
        this.listOfData.sort((a, b) => {
          return a.delivery_date > b.delivery_date ? 1 : -1;
        });
        console.log(this.listOfData);
      })
      .catch((err) => {
        console.log(err);
      });
  }

}
